package cn.yh.register.hosp.controller;

import cn.yh.register.common.result.Result;
import cn.yh.register.hosp.service.DepartmentService;
import cn.yh.register.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
//@CrossOrigin
@Api( tags = "科室管理接口")
@RestController
@RequestMapping("/admin/hosp/department")
public class DepartController {

    @Autowired
    DepartmentService departmentService;


    @ApiOperation("获取科室列表树形数据")
    @GetMapping("/getDeptList/{hoscode}")
    public Result<?> findDeptTree(@PathVariable String hoscode){
        List<DepartmentVo> voList = departmentService.findDeptTree(hoscode);
        return Result.ok(voList);
    }
}
